﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true" CodeBehind="ListOrganizations.aspx.cs" Inherits="MockPrjTeam2.Pages.Views.ListOrganizations" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <link href="../../Resource/CSS/style/reset.css" rel="stylesheet" type="text/css" />
    <link href="../../Resource/CSS/style/root.css" rel="stylesheet" type="text/css" />
    <link href="../../Resource/CSS/style/grid.css" rel="stylesheet" type="text/css" />
    <link href="../../Resource/CSS/style/typography.css" rel="stylesheet" type="text/css" />
    <link href="../../Resource/CSS/style/jquery-ui.css" rel="stylesheet" type="text/css" />
    <link href="../../Resource/CSS/style/jquery-plugin-base.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function Confirm_Active() {
            return confirm('Do you want to make this Organisation active ?');
        }
</script>
<asp:ScriptManager ID="MasterScriptManager" runat="server">
    </asp:ScriptManager>
      <div class="grid740 simplebox relative">
         
           <asp:UpdatePanel ID="UpdatePanel1" runat="server">
               
            <ContentTemplate>
                  <h2 style="color: #008000; background-color: #CCFFFF;" >Organization List</h2>
                <div class="titleh">
                   
                    <h3 class="sorting_range">
                         <asp:LinkButton ID="LinkButtonAll" runat="server" CssClass="hg-blue" CommandName="0-9-a-z"
                            OnCommand="FilterByLetters_Command">All</asp:LinkButton>
                        <asp:LinkButton ID="LinkButton09" runat="server" CommandName="0-9" OnCommand="FilterByLetters_Command">0-9</asp:LinkButton>
                        <asp:LinkButton ID="LinkButtonAE" runat="server" CommandName="a-e" OnCommand="FilterByLetters_Command">A B C D E</asp:LinkButton>
                        <asp:LinkButton ID="LinkButtonFJ" runat="server" CommandName="f-j" OnCommand="FilterByLetters_Command">F G H I J</asp:LinkButton>
                        <asp:LinkButton ID="LinkButtonKN" runat="server" CommandName="k-n" OnCommand="FilterByLetters_Command">K L M N</asp:LinkButton>
                        <asp:LinkButton ID="LinkButtonOR" runat="server" CommandName="o-r" OnCommand="FilterByLetters_Command">O P Q R</asp:LinkButton>
                        <asp:LinkButton ID="LinkButtonSV" runat="server" CommandName="s-v" OnCommand="FilterByLetters_Command">S T U V</asp:LinkButton>
                        <asp:LinkButton ID="LinkButtonWZ" runat="server" CommandName="w-z" CssClass="last"
                            OnCommand="FilterByLetters_Command"> W X Y Z</asp:LinkButton>
                          
                       
                    <span class="right">
                            <asp:HyperLink ID="LinkCreate" runat="server" CssClass="hg-blue" 
                            NavigateUrl="~/Pages/Forms/AddOrganizations.aspx" >Create</asp:HyperLink>
                            <asp:CheckBox ID="CheckBoxInactive"  runat="server" Text="Include In-active" 
                            AutoPostBack="True" oncheckedchanged="CheckBoxInactiveCheckedChanged"
                                 />
                        </span>
                    </h3>
                </div>
                
                
                
                <asp:GridView ID="GridViewOrg" CssClass="tablesorter" runat="server" AutoGenerateColumns="False"
                    AllowPaging="True" PageSize="15" 
                    Onpageindexchanging="GridViewOrg_PageIndexChanging" 
                    onrowdatabound="GridViewOrg_RowDataBound" 
                    
                    >
                    <Columns>
                        <asp:TemplateField HeaderText="Organisation Name" >
                           <ItemTemplate>
                                <asp:LinkButton ID="LinkButtonOrganizationName" CausesValidation="false" 
                                    runat="server" CommandName='<%# Eval("OrgID") %>' CommandArgument='<%#Eval("IsActive") %>'
                                    
                                    OnClientClick='<%# !(bool)Eval("IsActive") ? "return Confirm_Active();" : string.Empty %>' 
                                    OnCommand="LbnOrganizationName_Command" ToolTip="Click here View Detail and Edit"><%# Eval("OrganizationName")%></asp:LinkButton>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" Width="133px"/>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Head Office Address Line 1" >
                            <ItemTemplate>
                                <asp:Label ID="LabelHeadOffice" runat="server" 
                                    Text='<%# Eval("AddressLine1") %>' ></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Postcode" >
                            <ItemTemplate>
                                <asp:Label ID="LabelPostCode" runat="server" Text='<%# Eval("PostCode") %>' ></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" Width="120px"/>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Contact" SortExpression="Contact">
                            <ItemTemplate>
                                
                                <asp:Label ID="Label2" runat="server" Text='<%# Eval("ContactName") %>'></asp:Label>
                                
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" Width="137px"/>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Is Active?" >
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%#(bool) Eval("IsActive") ? "Yes" :"No" %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" Width="82px"/>
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        <blockquote>There are no items to show.</blockquote>
                    </EmptyDataTemplate>
                  <PagerStyle CssClass="pagination_table"></PagerStyle>
                   
                </asp:GridView>
                </ContentTemplate>
        </asp:UpdatePanel>
            </div>

</asp:Content>
